const notices = require("express").Router();
const NoticeController = require("../../../controllers/notice");
const { Validator, notice } = require("../../../validators");
// 获取公告列表
notices.get("/", Validator(notice.list), NoticeController.list);
// 添加公告
notices.post("/", Validator(notice.add), NoticeController.add);
// 获取公告详情
notices.get("/:id", Validator(notice.detail), NoticeController.detail);
// 修改公告
notices.patch("/:id", Validator(notice.update), NoticeController.update);
// 删除公告
notices.delete("/:id", Validator(notice.delete), NoticeController.delete);
// 修改公告状态
notices.put("/:id/status", Validator(notice.status), NoticeController.status);

module.exports = notices;
